/*
 * @Author: 姚潘涛
 * @Date: 2024-04-08 20:36:39
 * @LastEditors: 姚潘涛
 * @LastEditTime: 2024-04-09 09:32:42
 * @FilePath:
 * /xict_ws/src/xcmg-intelligent-cockpit-three/src/xict_ui/include/xict_ui/imageitem.h
 * @Description:
 *
 * Copyright (c) 2024 by pandaman, All Rights Reserved.
 */
#ifndef IMAGEITEM_H
#define IMAGEITEM_H

#include "xict_ui_common/utils/utils.h"
#include <QImage>
#include <QPainter>
#include <QQuickPaintedItem>
// #include "xrcu_driver/utils/baseimgsdk.h"

namespace xict_ui_core {
    class ImageItem : public QQuickPaintedItem {
        Q_OBJECT

        BJ_PROPERTY(int, cut_num)       // 屏幕总数
        BJ_PROPERTY(int, image_index)   // 图像编号
        BJ_PROPERTY(bool, top_screen)   // 是否为顶部屏幕
        BJ_PROPERTY(bool, revolve)      // 是否旋转
        BJ_PROPERTY(int, image_type);

    public:
        explicit ImageItem(QQuickItem* parent = nullptr);

        Q_INVOKABLE void paintFiveSceenImage(int show_state,
                                             QImage img);   // 绘制5 分屏
        Q_INVOKABLE void paintTwoOneTwoImage(int show_state,
                                             QImage img);   // 绘制212 分屏
        Q_INVOKABLE void
        paintMainFiveSceenImage(int show_state,   // 1主视野 0其它视野
                                QImage img);      // 绘制212 分屏

    protected:
        void paint(QPainter* painter);

    private:
        QImage m_image;
    };
}   // namespace xict_ui_core

#endif   // IMAGEITEM_H
